home *** CD-ROM | disk | FTP | other *** search
- /*
-
- Busy.mcc (c) 1994 by kmel, Klaus Melchior
-
- Example for Busy.mcc
-
- show_busy.c
-
- */
-
- /* DMAKE */
-
-
- /*** includes ***/
- #include <demo.h>
- #include <mui/busy_mcc.h>
-
- /*** defines ***/
- #define DEFAULT_COLOR1 1
- #define DEFAULT_COLOR2 2
- #define DEFAULT_SIZE 8
-
- /*** externals ***/
- extern char *vers_tag;
-
- /*** main ***/
- int main(int argc,char *argv[])
- {
- APTR app;
- APTR window;
- APTR bt_move, by_move;
- APTR sl_color1, sl_color2, sl_size;
-
- ULONG signals;
- BOOL running = TRUE;
-
- app = ApplicationObject,
- MUIA_Application_Title , "Show_BusyClass",
- MUIA_Application_Version , vers_tag + 6,
- MUIA_Application_Copyright , "©1994, kMel Klaus Melchior",
- MUIA_Application_Author , "Klaus Melchior",
- MUIA_Application_Description, "Demonstrates the busy class.",
- MUIA_Application_Base , "SHOWBUSY",
-
- SubWindow, window = WindowObject,
- MUIA_Window_Title, "BusyClass",
- MUIA_Window_ID , MAKE_ID('B','U','S','Y'),
- WindowContents, VGroup,
-
- /*** create a busy bar with a gaugeframe ***/
- Child, by_move = BusyBar,
- Child, bt_move = KeyButton("Move ...", 'm'),
-
- Child, ColGroup(2),
- Child, KeyLabel2("Color 1 :", '1'),
- Child, sl_color1 = KeySlider(0, 7, DEFAULT_COLOR1, '1'),
- Child, KeyLabel2("Color 2 :", '2'),
- Child, sl_color2 = KeySlider(0, 7, DEFAULT_COLOR2, '2'),
- Child, KeyLabel2("Size :", 's'),
- Child, sl_size = KeySlider(4, 20, DEFAULT_SIZE, 's'),
- End,
-
- End,
-
- End,
- End;
-
- if (!app)
- fail(app,"Failed to create Application.");
-
- /*** generate notifies ***/
- DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
- app, 2,
- MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
-
- DoMethod(bt_move, MUIM_Notify, MUIA_Timer, MUIV_EveryTime,
- by_move, 2,
- MUIM_Busy_Move, TRUE);
-
- DoMethod(sl_color1, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime,
- by_move, 3,
- MUIM_Set, MUIA_Busy_Color1, MUIV_TriggerValue);
-
- DoMethod(sl_color2, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime,
- by_move, 3,
- MUIM_Set, MUIA_Busy_Color2, MUIV_TriggerValue);
-
- DoMethod(sl_size, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime,
- by_move, 3,
- MUIM_Set, MUIA_Busy_Size, MUIV_TriggerValue);
-
- /*** ready to open the window ... ***/
- set(window,MUIA_Window_Open,TRUE);
-
- while (running)
- {
- switch (DoMethod(app,MUIM_Application_Input,&signals))
- {
- case MUIV_Application_ReturnID_Quit:
- running = FALSE;
- break;
- }
-
- if (running && signals)
- Wait(signals);
- }
-
- set(window, MUIA_Window_Open, FALSE);
-
-
- /*** shutdown ***/
- MUI_DisposeObject(app); /* dispose all objects. */
- fail(NULL,NULL); /* exit, app is already disposed. */
- }
-
-